<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>Kinetis Bootloader Host: elftosb::version_t Struct Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="nxp_logo_small.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Kinetis Bootloader Host
   &#160;<span id="projectnumber">2.0.0</span>
   </div>
   <div id="projectbrief">Host Tools for Kinetis devices</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Introduction</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('structelftosb_1_1version__t.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-attribs">Public Attributes</a> &#124;
<a href="structelftosb_1_1version__t-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">elftosb::version_t Struct Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Same version struct used for 3600 boot image.  
 <a href="structelftosb_1_1version__t.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="_version_8h_source.html">Version.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:aab9a687fd58a948400b6e72e730bbfd7"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aab9a687fd58a948400b6e72e730bbfd7"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>version_t</b> (uint16_t maj, uint16_t min, uint16_t rev)</td></tr>
<tr class="separator:aab9a687fd58a948400b6e72e730bbfd7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2896acb40cd175e37ab3c82315d4fd83"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2896acb40cd175e37ab3c82315d4fd83"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>version_t</b> (const std::string &amp;versionString)</td></tr>
<tr class="separator:a2896acb40cd175e37ab3c82315d4fd83"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa1a92d922105a7f9306957f76807b55f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structelftosb_1_1version__t.html#aa1a92d922105a7f9306957f76807b55f">set</a> (const std::string &amp;versionString)</td></tr>
<tr class="memdesc:aa1a92d922105a7f9306957f76807b55f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the version by parsing a string.  <a href="#aa1a92d922105a7f9306957f76807b55f">More...</a><br /></td></tr>
<tr class="separator:aa1a92d922105a7f9306957f76807b55f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af19e497d06c542558941c69290cc59ec"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structelftosb_1_1version__t.html#af19e497d06c542558941c69290cc59ec">fixByteOrder</a> ()</td></tr>
<tr class="memdesc:af19e497d06c542558941c69290cc59ec"><td class="mdescLeft">&#160;</td><td class="mdescRight">Converts host endian BCD version values to the equivalent big-endian BCD values.  <a href="#af19e497d06c542558941c69290cc59ec">More...</a><br /></td></tr>
<tr class="separator:af19e497d06c542558941c69290cc59ec"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:a41ea4cd795ab58fb1aa904665c8150e4"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a41ea4cd795ab58fb1aa904665c8150e4"></a>
uint16_t&#160;</td><td class="memItemRight" valign="bottom"><b>m_major</b></td></tr>
<tr class="separator:a41ea4cd795ab58fb1aa904665c8150e4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9821c87f6b1636d3dce459d0fff1fbb5"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9821c87f6b1636d3dce459d0fff1fbb5"></a>
uint16_t&#160;</td><td class="memItemRight" valign="bottom"><b>m_pad0</b></td></tr>
<tr class="separator:a9821c87f6b1636d3dce459d0fff1fbb5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae386340bb1e4efac9634cb104bb51ed0"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae386340bb1e4efac9634cb104bb51ed0"></a>
uint16_t&#160;</td><td class="memItemRight" valign="bottom"><b>m_minor</b></td></tr>
<tr class="separator:ae386340bb1e4efac9634cb104bb51ed0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4d1092b370107ef10df23f8fdeb25092"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4d1092b370107ef10df23f8fdeb25092"></a>
uint16_t&#160;</td><td class="memItemRight" valign="bottom"><b>m_pad1</b></td></tr>
<tr class="separator:a4d1092b370107ef10df23f8fdeb25092"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0114d8b80e80e6e9ceb66627d3f2fede"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0114d8b80e80e6e9ceb66627d3f2fede"></a>
uint16_t&#160;</td><td class="memItemRight" valign="bottom"><b>m_revision</b></td></tr>
<tr class="separator:a0114d8b80e80e6e9ceb66627d3f2fede"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad4e3c7fff4fbff8881cde53476241ebf"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad4e3c7fff4fbff8881cde53476241ebf"></a>
uint16_t&#160;</td><td class="memItemRight" valign="bottom"><b>m_pad2</b></td></tr>
<tr class="separator:ad4e3c7fff4fbff8881cde53476241ebf"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Same version struct used for 3600 boot image. </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="af19e497d06c542558941c69290cc59ec"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void version_t::fixByteOrder </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Converts host endian BCD version values to the equivalent big-endian BCD values. </p>
<p>The output is a half-word. And BCD is inherently big-endian, or byte ordered, if you prefer to think of it that way. So for little endian systems, we need to convert the output half-word in reverse byte order. When it is written to disk or a buffer it will come out big endian.</p>
<p>For example:</p><ul>
<li>The input is BCD in host endian format, so 0x1234. Written to a file, this would come out as 0x34 0x12, reverse of what we want.</li>
<li>The desired BCD output is the two bytes 0x12 0x34.</li>
<li>So the function's uint16_t result must be 0x3412 on a little-endian host.</li>
</ul>
<p>On big endian hosts, we don't have to worry about byte swapping. </p>

</div>
</div>
<a class="anchor" id="aa1a92d922105a7f9306957f76807b55f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void version_t::set </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>versionString</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets the version by parsing a string. </p>
<p>Parses a string in the form "xxx.xxx.xxx" (where x is a digit) into three version fields for major, minor, and revision. The output is right aligned BCD in host-natural byte order.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">versionString</td><td>String containing the version. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/>The documentation for this struct was generated from the following files:<ul>
<li><a class="el" href="_version_8h_source.html">Version.h</a></li>
<li>Version.cpp</li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><b>elftosb</b></li><li class="navelem"><a class="el" href="structelftosb_1_1version__t.html">version_t</a></li>
    <li class="footer">Generated on Mon Mar 7 2016 16:49:52 for Kinetis Bootloader Host by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
  </ul>
</div>
</body>
</html>
